<?php


class StringUtils
{
    /**
     * 判断是否以 某个字符串开始
     * @param $string
     * @param $sub_string
     * @return bool
     */
    public static function startWith($string, $sub_string)
    {
        return substr($string, 0, strlen($sub_string)) === $sub_string;
    }

    /**
     * 以某个字符串结尾
     * @param $string
     * @param $sub_string
     * @return bool
     */
    public static function endWith($string, $sub_string)
    {
        return substr($string, strpos($string, $sub_string)) === $sub_string;
    }
}